package com.lineage.data.item_etcitem;

import com.lineage.data.executor.ItemExecutor;
import com.lineage.server.model.Instance.L1ItemInstance;
import com.lineage.server.model.Instance.L1PcInstance;
import com.lineage.server.model.L1Object;
import com.lineage.server.model.L1Teleport;
import com.lineage.server.serverpackets.S_ServerMessage;
import com.lineage.server.serverpackets.S_SystemMessage;
import com.lineage.server.serverpackets.ServerBasePacket;
import com.lineage.server.world.World;

public class onlygm extends ItemExecutor {
  public static ItemExecutor get() {
    return new onlygm();
  }
  
  public void execute(int[] data, L1PcInstance pc, L1ItemInstance item) {
    int spellsc_objid = data[0];
    int itemId = item.getItemId();
    L1Object target = World.get().findObject(spellsc_objid);
    L1PcInstance target_pc = (L1PcInstance)target;
    if (itemId == 240309) {
      target_pc.setSkillEffect(9990, 21600000);
      L1Teleport.teleport(target_pc, 32768, 32773, (short)7787, 5, true);
      target_pc.sendPackets((ServerBasePacket)new S_SystemMessage("因为您未通过线上GM验证，即刻起将入监6个小时。"));
      target_pc.sendPackets((ServerBasePacket)new S_ServerMessage("\\fX请保持角色在线以扣除监禁时间。"));
    } else if (itemId == 240310) {
      target_pc.setSkillEffect(9990, 43200000);
      L1Teleport.teleport(target_pc, 32768, 32773, (short)7787, 5, true);
      target_pc.sendPackets((ServerBasePacket)new S_SystemMessage("因为您未通过线上GM验证，即刻起将入监12个小时。"));
      target_pc.sendPackets((ServerBasePacket)new S_ServerMessage("\\fX请保持角色在线以扣除监禁时间。"));
    } else if (itemId == 240311) {
      target_pc.setSkillEffect(9990, 86400000);
      L1Teleport.teleport(target_pc, 32768, 32773, (short)7787, 5, true);
      target_pc.sendPackets((ServerBasePacket)new S_SystemMessage("因为您未通过线上GM验证，即刻起将入监24个小时。"));
      target_pc.sendPackets((ServerBasePacket)new S_ServerMessage("\\fX请保持角色在线以扣除监禁时间。"));
    } else if (itemId == 240312 && target_pc.hasSkillEffect(9990)) {
      target_pc.killSkillEffectTimer(9990);
      target_pc.sendPackets((ServerBasePacket)new S_ServerMessage("\\fX您的监禁时间已解除。"));
    } 
  }
}
